﻿#region Usings

using System.Data.Entity.ModelConfiguration;
using Rail.Net.Core.Model;

#endregion

namespace Rail.Net.Data.Configuration
{
    public class ContengentTrainLabelMap : EntityTypeConfiguration<ContengentTrainLabel>
    {
        public ContengentTrainLabelMap()
        {
            ToTable("ContengentTrainLabels");
            HasKey(contengentTrainLabel => contengentTrainLabel.Id);

            Property(contengentTrainLabel => contengentTrainLabel.TrainLabel).IsRequired().HasMaxLength(10);
            Property(contengentTrainLabel => contengentTrainLabel.Domestic).IsRequired();
            Property(contengentTrainLabel => contengentTrainLabel.International).IsRequired();
            Property(contengentTrainLabel => contengentTrainLabel.ValidFrom).IsOptional();
            Property(contengentTrainLabel => contengentTrainLabel.ValidTo).IsOptional();
        }
    }
}